﻿@{
    ViewBag.Title = "FundPeopleEdit";
    Layout = "~/Areas/Admin/Views/Shared/_LayoutCMS.cshtml";
}
@section htmlhead{
    <link href="~/Content/editor/themes/default/default.css" rel="stylesheet" />
    <link href="~/Content/assets/css/Layout/css/main.css" rel="stylesheet" />
    <link href="~/Content/assets/css/plugin/validator.css" rel="stylesheet" />
    <link href="~/Content/assets/css/plugin/xjgrid.css" rel="stylesheet" />
    
    <script src="~/Content/assets/layer/layer.min.js"></script>
}
@model LY.Entity.T_FundManager   
<div class="container">

    <div id="forms" class="mt10" aria-disabled="False">
        <div class="box">
            <div class="box_border">
                <div class="box_top"><b class="pl15">编辑基金人信息</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;带‘<span style="color:red;">*</span>’标识为必填项 </div>
                <div class="box_center">
                    <form  id="frmEdit" method="post" action="@Url.Action("FundPeopleSave")" role="form" class="jqtransform">
                        <input id="hideId" name="ID" value="@Model.ID" type="hidden" />
                        <table class="form_table pt15 pb15" style="width: 100%;" border="0">
                            <tr>
                                <td class="td_right"><b style="color:red;">*&nbsp;&nbsp;</b>基金人：</td>
                                <td class="">
                                    <input type="text" id="Name" name="Name" value="@Model.Name" maxlength="12"  class="input-text lh30" size="40">
                                </td>
                                  <td class="td_right"><b style="color:red;">*&nbsp;&nbsp;</b>基金：</td>
                                <td class="">
                                      @Html.ResourceDropDownList("FundID", "FUND",Model.FundID, new { @class="wh150 select"})
                                    @*<input type="text" id="" name="Headportrait" value="@Model.Headportrait" class="input-text lh30" size="40">*@
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">文化程度：</td>
                                <td class="">
                                       @Html.ResourceDropDownList("Education", "EDUCATION", @Model.Education,new {@class="wh80 select" })
                                </td>
                                   <td class="td_right">工作年限：</td>
                                <td class="">
                                    <input type="text" id="WorkingYears" name="WorkingYears" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')"   value="@Model.WorkingYears" maxlength="2"  class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">毕业院校：</td>
                                <td class="">
                                    <input type="text" id="Graduated" name="Graduated" value="@Model.Graduated" maxlength="15"  class="input-text lh30" size="40">
                                </td>
                                  <td class="td_right">从业背景：</td>
                                <td class="">
                                    <input type="text" id="Businessbg" name="Businessbg" value="@Model.Businessbg" maxlength="20" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">过往机构：</td>
                                <td class="">
                                    <input type="text" id="Pastagencies" name="Pastagencies"  value="@Model.Pastagencies" maxlength="20"  class="input-text lh30" size="40">
                                </td>
                                <td class="td_right">头像：</td>
                                <td class="">
                                    <input type="hidden" id="hidHeadportrait" name="Headportrait" value="@Model.Headportrait" />
                                    <img src="@Model.Headportrait" id="showimg" height="100" width="80"/>
                                    <input type="button" id="btnUploadImg" value=" 上传文件" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">人物介绍：</td>
                                <td class="" colspan="3" >
                                  <textarea id="Peopleremark" name="Peopleremark" maxlength="1000" rows="10" style="border:2px solid #E4EDF3;width:95%;">@Model.Peopleremark</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_center" colspan="5">
                                    <input type="button" id="btnSave" name="button" style="margin-right: 50px;" class="btn btn82 btn_save2" value="保存">
                                    <input type="button" id="btnReturn" name="button" class="btn btn82 btn_res" value="返回">
                                </td>
                            </tr>
                        </table>
                         <input type="hidden" id="hideContent" name="Peopleremark" />
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section jssection{
    <script type="text/javascript">
        var util = {};
        var options = {
            editUrl: "@Url.Action("FundPeopleSave")",
            uploadUrl: "@Url.Action("UploadImg", "Helper")"
        };
        $(document).ready(function () {
            //初始化图片上传  
            var btnImg = document.getElementById("btnUploadImg");
            g_AjxUploadImg(btnImg);

        });
        var g_AjxTempDir = "/FileUpload/";
        //图片上传  
        function g_AjxUploadImg(btn) {
            var button = btn, interval;
            new AjaxUpload(button, {
                action: options.uploadUrl,
                data: {},
                name: 'myfile',
                onSubmit: function (file, ext) {
                    if (!(ext && /^(jpg|JPG|png|PNG|gif|GIF)$/.test(ext))) {
                        alert("您上传的图片格式不对，请重新选择！");
                        return false;
                    }
                },
                onComplete: function (file, response) {
                    flagValue = response;
                    if (flagValue == "-1") {
                        alert("您上传的图片格式不对，请重新选择！");
                    }
                    else if (flagValue == "-2") {
                        alert("您上传的图片大于2兆，请重新选择！");
                    }
                    else if (flagValue == "-3") {
                        alert("图片上传失败！");
                    }
                    else {

                        var strs = new Array();
                        strs = response.split("/");

                        var oldname = strs[0];
                        var newname = strs[1];
                        var filepath = strs[2];


                        var src = g_AjxTempDir + filepath + "/" + newname;
                        $("#hidHeadportrait").val(src);
                        $("#showimg").attr("src",src);
                        //var newimg = [];
                        //newimg.push('<div><div class="cp_img" id="2679">');
                        //newimg.push('<img class="imgShow" src=' + src + ' alt="" height="100" width="100" />');
                        //newimg.push('</div>');
                        //$(newimg.join('')).appendTo('#div_img');
                    }
                }
            });
        }
    </script>
    <script src="~/Content/assets/plugins/validator/validator.js"></script>
    <script src="~/Content/assets/js/common.js"></script>
    <script src="~/Content/assets/DatePicker/WdatePicker.js"></script>
    <script src="~/Content/assets/layer/layer.min.js"></script>
    <script src="~/Content/assets/app/common/ajaxupload.js"></script>
    <script src="~/Content/assets/app/Fund/fundpeopleedit.js"></script>
}


